
fn main()
{
    let s = String::from("broadcast");

    //[)
    let part1 = &s[0..5];
    let part2 = &s[5..9];
    
    println!("p1 = {}  \np2 = {}", part1, part2);


    //线性数据结构也支持切片
    let arr = [1, 2 ,4 ,5];

    println!{"arr = {:?}", arr};
    let a1 = &arr[0..2];

    let a2 = &arr[3..];

    println!{"{:?} {:?}", a1, a2};

}
